package main;

public class Person implements Comparable<Person> {

	/**
	 * 
	 */
	private String nom = "";
	private long val = 0;
	private java.util.Date date = new java.util.Date();

	public Person(String nom, long val) {
		this.nom = nom;
		this.val = val;
	}

	public Person(Person p) {
		this.nom = p.nom;
		this.val = p.val;
		if (date != null)
			this.date = p.date;
	}

	public Person(String nom, long val, java.util.Date date) {
		this.nom = nom;
		this.val = val;
		if (date != null)
			this.date = date;
	}

	public String getNom() {
		return this.nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public long getVal() {
		return this.val;
	}

	public void setVal(long val) {
		this.val = val;
	}

	public java.util.Date getDate() {
		return this.date;
	}

	public void setDate(java.util.Date date) {
		this.date = date;
	}

	@Override
	public int compareTo(Person arg0) {
		return getNom().compareTo(arg0.getNom());
	}

	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append(nom).append(" ").append(val).append(" ").append(date);
		return sb.toString();
	}

}
